<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{% extends 'learning_logs/base.html' %}
{% block content %}
    {#    用于显示错误信息#}
    {% if form.errors %}
        <p>Your username or password didn't match. Please try again.</p>
    {% endif %}
    <form method="post" action="{% url 'users:login' %}">
        {% csrf_token %}
        {{ form.as_p }}
        <button name="submit">Log in</button>
        {#        隐藏的表单元素next，value告诉在操作成功后重定向到哪里#}
        <input type="hidden" name="next"
               value="{% url 'learning_logs:index' %}">
    </form>
{% endblock content %}
</body>
</html>